/*
 * @Description:基础搜索表单+表格
 * @Author: yyang
 * @Date: 2022-01-13 10:46:29
 * @LastEditTime: 2022-12-14 10:36:17
 * @LastEditors: yyang
 * @Reference:
 */
export function getTableScroll(extraHeight, id) {
	//搜索表单高度
	let searchFormHeight =
		document.querySelectorAll(".main .header")[0].offsetHeight;
		console.log(searchFormHeight);
	//表头工具栏高度
	let tableOperationsHeight =
		document.querySelectorAll(".table-operations")[0].offsetHeight;
	let tHeader = null;
	let totalPadding = 100;
	let pagerHeight = 52;
	let breadcrumbHeight = 52;
	let bodyHeader = 60;

	if (id) {
		tHeader = document.getElementById(id) ? document.getElementById(id).getElementsByClassName("ant-table-thead")[0] : null
	} else {
		tHeader = document.getElementsByClassName("ant-table-thead")[0].offsetHeight
	}
	//窗体高度-表格内容顶部的高度-表格内容底部的高度
	let clientHeight = document.documentElement.clientHeight;
	let height =
		clientHeight - bodyHeader - tHeader - totalPadding - pagerHeight - breadcrumbHeight - searchFormHeight - tableOperationsHeight;

	// console.log('可视区域高',clientHeight);
	// console.log('表头高',tHeader);
	// console.log('其他合计高度',extraHeight);
	// console.log('目前高度',height);
	return height
}


/**
 * @description: 获取自定义表格的高度 ,待更新
 * @return {*}
 * @author: yyang
 */
export function getScroll(extraHeight, id) {
	console.log(123);
	let tHeader = null;
	if (id) {
		tHeader = document.getElementById(id) ? document.getElementById(id).getElementsByClassName("ant-table-thead")[0].offsetHeight : 0
	} else {
		tHeader = document.getElementsByClassName("ant-table-thead")[0].offsetHeight
	}
	//窗体高度-表格内容顶部的高度-表格内容底部的高度
	let clientHeight = document.documentElement.clientHeight
	let height = clientHeight - tHeader - extraHeight
	// console.log('可视区域高',clientHeight);
	// console.log('表头高',tHeader);
	// console.log('其他合计高度',extraHeight);
	// console.log('目前高度',height);
	return height

}